package jvm;

/**
 * Created by duan lian on 2017-08-03.
 */
public class JVMStackSOF {
	int stackDeepth=1;
	void recursively() {
		stackDeepth++;
		recursively();
	}

	// VM args: -Xss128k
	// -Xss栈大小 -Xoss: native method stack，对Hotspot VM无效（其不区分vm stack、native method stack）
	public static void main(String[] args) {
		JVMStackSOF jvmStackSOF = new JVMStackSOF();
		try{
			jvmStackSOF.recursively();
		}catch (Throwable e) {
			System.out.println("stack deepth: " + jvmStackSOF.stackDeepth);
			throw e;
		}
	}
}
